package com.example.stock.entity.dao;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.stock.entity.eo.UnitEo;
import com.example.stock.entity.mapper.UnitMapper;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UnitDao extends ServiceImpl<UnitMapper, UnitEo> {

    public Integer getMaxId() {
        Integer maxId = getBaseMapper().getMaxId();
        return maxId++;
    }
    public List<UnitEo> listByRuleId(Integer id) {
        List<UnitEo> list = list(Wrappers.<UnitEo>lambdaQuery().eq(UnitEo::getRuId, id));
        return list;
    }
}